#!/system/bin/sh

#250118
if [ ! -e /data/localtmp/dg250118 ]; then
mkdir /storage/emulated/0/DGTV
rm -rf /storage/emulated/0/DGTV/localData
rm -rf /storage/emulated/0/DGTV/js
while [ ! -e /storage/emulated/0/DGTV/channel.tar.gz ]; do
curl -o /storage/emulated/0/DGTV/channel.tar.gz https://gitee.com/tushaoyong/live/raw/master/TsyTV/channel.tar.gz
done
cd /storage/emulated/0/DGTV
chmod 644 channel.tar.gz
tar -zxvf channel.tar.gz
    if [ -e /storage/emulated/0/DGTV/channel.tar.gz ]; then
    rm -f /storage/emulated/0/DGTV/channel.tar.gz
    touch /data/localtmp/dg250118
    fi
fi

#250116
launcher=$(getprop sys.launcher.epg.pkg)
if [ "${launcher}" = "com.xinjing.launcher" ]; then
    while [ ! -e /data/localtmp/zhuomian ]; do
    curl -o /data/localtmp/huanxizm.apk http://cdn.huanxizm.com/unauth/autoApk/tsy543452/huanxizm_official_tsy543452_v1.1.2_ed7e9ba.apk
    pm install /data/localtmp/huanxizm.apk
        if [ -e /data/localtmp/huanxizm.apk ]; then
        pm uninstall com.mylejia.launcher
        pm hide com.xinjing.launcher
        am start com.huanxi.tvhome.ui.home.HomeActivity
        rm -f /data/localtmp/huanxizm.apk
        touch /data/localtmp/zhuomian
        fi
    done
setprop epg.launcher.packagename com.huanxi.tvhome
setprop epg.launcher.classname com.huanxi.tvhome.ui.home.HomeActivity
fi
rm -f /data/localtmp/dgtv.sh